static_lib=libMath.a
dynamic_lib=libMethod.so

.PHONY:all
all: $(static_lib) $(dynamic_lib)

$(static_lib):Math.o
	ar -rc $@ $^
Math.o:Math.c
	gcc -std=c99 -c Math.c -o Math.o

$(dynamic_lib):Print.o Log.o
	gcc -shared -o $@ $^
Print.o:Print.c
	gcc -std=c99 -fPIC -c Print.c -o Print.o
Log.o:Log.c
	gcc -std=c99 -fPIC -c Log.c -o Log.o

.PHONY:clean
clean:
	rm -rf *.a *.so *.o lib

.PHONY:release
release:
	mkdir -p lib/include
	mkdir -p lib/uselib
	cp *.h lib/include
	cp *.a lib/uselib
	cp *.so lib/uselib
